Okay, I finally finished my amper package (see related topic, "2 byte reads/writes", below :), and thought that everything was peachy keen, as all the routines worked fine in individual tests. However, put them together in a program, and you start getting problems. For example...
1 GOTO 2000
50 IF LEFT$(FI$,2)="2/" THEN FI$=P2$+MID$(FI$,3)
51 RETURN
60 GOSUB 50: & TYPE (FI$) :REM dump the specified text file
61 RETURN
2000 & INPUT "path> ",FI$:& CHK(FI$):IF NOT PEEK(222) THEN GOSUB 60
Okay, you can get an idea of what that's supposed to do. Unfortunately, try running it, and you get
?FORMULA TOO COMPLEX ERROR IN 50
My question: What can cause this error?? The manuals only say "more than two IF xx statements in an expression" or something to that effect. Obviously, my code isn't that complicated; however, I DO use FrmEvl ($DD7B) in several of the ampers called before the error occurs. Could that be messing up some sort of pointers??
Thanks, :)...
--Joey
Path: BASIC/Formula too Complex?!?
Subj: Too many string temps? 90-09-25 19:43:30 EST
From: Eight bits
Posted on: America Online
Hi, Joe
I've got more ideas, but again, if anyone knows these things, please jump in.
It looks like you can also get the FORMULA TOO COMPLEX error if you have too many temporary strings. Try the following:
10 A$ = "A"
20 PRINT A$ + ("B" + ("C" + "D"))
30 PRINT "A" + ("B" + ("C" + "D"))
Line 30 seems to have one temp too many.
I think that when you call FrmEvl and it finds a variable name such as FI$ then it just gives you the descriptor in the variable table, but if FrmEvl instead finds a string expression or constant such as "path> " then it builds a temporary descriptor. But if you don't then free up this temporary descriptor then I suspect it will limit the number of future temporaries that can be created, causing the error. It looks to me from the Crossley article that you could call FreStr at $E5FD after each call to FrmEvl. The idea would be to free up any temporaries, while still providing you with the string address (in Index, and in Y,X) and with the string length (in A).
I've never used FreStr though, and of course I haven't tried it here since I don't have the amper routines. Does it work?
Jerry
Path: BASIC/Formula too Complex?!?
Subj: FreStr... 90-09-25 22:14:25 EST
From: AFA JoeyS
Posted on: America Online
Oh. I didn't even see that one. %) I have no idea, Jerry, but I'll take a look -- and you've been quite on the target in the past, so I'm optimistic. :)
I'll report back later.
Path: BASIC/Formula too Complex?!?
Subj: It worked, :)... 90-09-26 00:52:25 EST
From: AFA JoeyS
Posted on: America Online
What a nice change of pace; a quick solution to a problem, LOL.
Thanks muchly, Jerry, you were quite right: adding a JSR FreStr after the JSR FrmEvl seems to keep BASIC happy. Really nice job there coming up with the answer so quickly... ()()()() :)
(now I'm taking bets for how long it'll be before my NEXT silly Applesoft <--> M/L problem comes along...)